package com.googlecode.iiddefecttracker.domain;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * default bean implementation of {@link Defect}.
 */
public class DefectBeanImpl implements Defect {
    
    private Long id;
    private String summary;
    private Project project;
    private String stepsToRecreate;
    private String result;
    private String expectedResult;
    private String workaround;
    
    @Override
    public boolean equals(final Object obj) {
        if (obj instanceof DefectBeanImpl == false) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        final DefectBeanImpl rhs = (DefectBeanImpl) obj;
        
        return EqualsBuilder.reflectionEquals(this, rhs);
    }
    
    public String getExpectedResult() {
        return expectedResult;
    }
    
    public Long getId() {
        return id;
    }
    
    public Project getProject() {
        return project;
    }
    
    public String getResult() {
        return result;
    }
    
    public String getStepsToRecreate() {
        return stepsToRecreate;
    }
    
    public String getSummary() {
        return summary;
    }
    
    public String getWorkaround() {
        return workaround;
    }
    
    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }
    
    public void setExpectedResult(final String expectedResult) {
        this.expectedResult = expectedResult;
    }
    
    public void setId(final Long id) {
        this.id = id;
    }
    
    public void setProject(final Project project) {
        this.project = project;
    }
    
    public void setResult(final String result) {
        this.result = result;
    }
    
    public void setStepsToRecreate(final String stepsToRecreate) {
        this.stepsToRecreate = stepsToRecreate;
    }
    
    public void setSummary(final String summary) {
        this.summary = summary;
    }
    
    public void setWorkaround(final String workaround) {
        this.workaround = workaround;
    }
}
